#ifndef _LIBAPI_H
#define _LIBAPI_H

#include <libapi_t.h>
#include <krltime.h>
#include <sycparam.h>

/* 内存相关 */

void * api_mem_mallocblk (size_t blksz);
sysstus_t api_mem_freeblk (void * addr, size_t blksz);

/* 进程相关 */

hand_t api_thread_exel (void * file, uint_t flag);
void api_thread_exit (void);
hand_t api_thread_getid (void * tdname);

/* 文件相关 */

hand_t api_fs_open (void * file, uint_t flag, uint_t status);
sysstus_t api_fs_close (hand_t hand);
sysstus_t api_fs_read (hand_t hand, buf_t buf, size_t len, uint_t flag);
sysstus_t api_fs_write (hand_t hand, buf_t buf, size_t len, uint_t flag);
sysstus_t api_fs_ioctl (hand_t hand, buf_t buf, uint_t ioctlcmd, uint_t flag);
sysstus_t api_fs_lseek (hand_t hand, uint_t lofset, uint_t flag);

/* 时间相关 */

sysstus_t api_time_gettime (time_t * time);

#endif
